import UserValidator from '../validators/user.js'
const { UserLoginValidator } = UserValidator
import UserService from '../services/UserService.js'
import Resolve from '../utils/resolve.js'

const res = new Resolve()

class UserController
{
    async login(ctx) {
        const v = await new UserLoginValidator().validate(ctx)

        const service = new UserService;

        const user = await service.getUserById(4);
        ctx.body = res.json(user)
    }

    async list(ctx) {
        const service = new UserService;

        const user = await service.list()
        ctx.body = res.json(user)
    }
}

export default UserController